#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QComboBox>
#include <QPushButton>
#include "hserialport.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    HSerialPort *m_port;
    virtual int  write(QByteArray &ucDataArray);// 写数据

public slots:
    void onAvailablePortsChanged(QStringList ports);
    void onSerialPortOpenOrClosed(bool flag);

private:
    Ui::MainWindow *ui;

    QComboBox *m_cbBox;
    QPushButton *m_btn;
};
#endif // MAINWINDOW_H
